function getName(xing:string,ming?:string):string{
    if(ming){
        return xing+ming;
    }else{
        return xing;
    }
}

console.log(getName("张"));//张
console.log(getName("李", "小明"));//李小明
// console.log(getName("李", "小明",'明'));//报错，参数太多了
